package com.exam.scjp5.objectives.section_1;

public class ExampleScoping
{
    public static void main(String... args)
    {
        new ScopeParent().test();
    }
}

class ScopeParent
{
    private int same;
    
    public void test()
    {
        ScopeChild c = new ScopeChild();
        ((ScopeParent)c).same = 10;   
        System.out.println("Parent : " + ((ScopeParent)c).same);
        c.printSame();
    }
}

class ScopeChild extends ScopeParent
{
    private int same;
    
    public void printSame()
    {
        System.out.println("Child : " + same);
    }
   
}
